#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2021/11/17 18:39
# @Author  : huidong.bai
# @File    : run.py
# @Software: PyCharm
import os
import subprocess

import pytest


if __name__ == '__main__':
    # pytest.main(['-vs'])
    # cmd = 'pytest -vs ./testcase/test_ioc.py --sn=1110000102130196015295 --task_id=28 --rom_version=0 --system_version=0 --type_id=31 --is_smoke=false --speakerVersion=1.6.10 --romVersion=1.6.10'
    # sub = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    #
    # line = sub.stdout.readlines()
    # for i in line:
    #     print(i)
    # adb shell tail -F userdata/OrionOSClientSDK.log
    # sub = subprocess.Popen('ping www.baidu.com', encoding='utf-8', universal_newlines=True, stdout=subprocess.PIPE).stdout.read()
    # for line in sub:
    #     print(1111111111111)
    #     print(line)
    import requests
    import json
    data = {
        "com": "111000010213019416Z072",
        "run_status": 0
    }
    # 这里将音箱的状态设置为0
    response = requests.post(f'http://api.mydjangoproject.cn:8000/speakerDetail/setStatus/', data=data)
    params = json.loads(response.text)
    print('全局后置结束：%s' % params)

